package com.zzyl.entity;

import com.zzyl.base.BaseEntity;
import com.zzyl.enums.ReservationStatus;
import lombok.Data;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.Date;

@Data
public class Reservation extends BaseEntity {
    private String name; // 预约人姓名
    private String mobile; // 预约人手机号
    private Date time; // 预约时间
    private String visitor; // 探访人
    private Integer type; // 预约类型，0：参观预约，1：探访预约
    private Integer status; // 预约状态，0：待报道，1：已完成，2：取消，3：过期

    @Scheduled(cron = "* 30 * * * ?")
    public void setCancel(){
        Reservation.this.setStatus(ReservationStatus.EXPIRED.getOrdinal());
    }
}
